<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:cc="http://java.sun.com/jsf/composite"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <!-- INTERFACE -->
    <cc:interface>
        <cc:attribute name="controller" />
        <cc:attribute name="bill" />
        <cc:attribute name="dup" />
    </cc:interface>

    <!-- IMPLEMENTATION -->
    <cc:implementation>



        <h:outputStylesheet library="css" name="printing.css"></h:outputStylesheet>
        <div  >
            <h:panelGroup id="gpBillPreview" >

                <div class="fiveinchbillBreak" >

                    <div class="billNamePrinting" style=" position: absolute;left: 40%;top: 30%;">
                        <h:outputLabel value="PAYMENT VOUCHER"   />                           
                    </div>

                    <div class="receiptnoPrinting" >
                        <h:outputLabel value="#{cc.attrs.bill.cancelledBill.insId} **Cancelled"  
                                       rendered="#{cc.attrs.bill.cancelledBill.insId ne null}"/> 
                        <h:outputLabel value="#{cc.attrs.bill.insId}" 
                                       rendered="#{cc.attrs.bill.cancelledBill.insId eq null}"/>  
                        <h:outputLabel value="  **Duplicate" 
                                       rendered="#{cc.attrs.bill.cancelledBill.insId eq null and cc.attrs.dup eq true }" />
                    </div>

                    <div class="billdatePrinting">                   
                        <h:outputLabel value="#{cc.attrs.bill.cancelledBill.billDate}"
                                       rendered="#{cc.attrs.bill.cancelledBill.insId ne null}"  >
                            <f:convertDateTime pattern="dd/MM/yy"/>
                        </h:outputLabel>                      
                        <h:outputLabel value="#{cc.attrs.bill.billDate}"
                                       rendered="#{cc.attrs.bill.cancelledBill.insId eq null }">
                            <f:convertDateTime pattern="dd/MM/yy"/>
                        </h:outputLabel>
                    </div>

                    <div class="paymentPrinting">                    
                        <h:outputLabel value="#{cc.attrs.bill.cancelledBill.paymentMethod}" 
                                       rendered="#{cc.attrs.bill.cancelledBill.insId ne null}" />                        
                        <h:outputLabel value="#{cc.attrs.bill.paymentMethod}" 
                                       rendered="#{cc.attrs.bill.cancelledBill.insId eq null }"/>
                    </div>

                    <div class="billtimePrinting">

                        <h:outputLabel value="#{cc.attrs.bill.cancelledBill.billTime}"  
                                       rendered="#{cc.attrs.bill.cancelledBill.insId ne null}">
                            <f:convertDateTime pattern="hh mm a"/>
                        </h:outputLabel>                        
                        <h:outputLabel value="#{cc.attrs.bill.billTime}" 
                                       rendered="#{cc.attrs.bill.cancelledBill.insId eq null }">
                            <f:convertDateTime pattern="hh mm a"/>
                        </h:outputLabel>
                    </div>




                    <h:outputLabel value="#{cc.attrs.bill.staff.person.name}" styleClass="ptnamePrinting" style="text-transform: capitalize; "  />

<!--                    <div class="cashierPrinting">

                        <h:outputLabel value="Cashier : #{cc.attrs.bill.creater.code}"   />
                    </div>-->

                    <!--                    <div class="consultPrinting">
                                            
                                            <h:outputLabel value="#{cc.attrs.bill.staff.person.name}"   />
                                        </div>-->

                    <div class="itemsPrinting">

                        <h:dataTable value="#{cc.attrs.controller.billItems}" var="bip" style="font-size:11px!important;"     >

                            <h:column >
                                <h:outputLabel value="#{bip.referanceBillItem.bill.insId}"  />                                    
                            </h:column>

                        </h:dataTable>
                        <p:spacer height="7px;"></p:spacer>
                        <table style="min-width:100%;padding-left: 20px;">
                            <tr>
                                <td style="min-width: 3.5cm;text-align: left;">
                                    <h:outputLabel value="TOTAL"/>
                                </td>
                                <td>
                                    <h:outputLabel value="#{-cc.attrs.bill.netTotal}"  style="font-weight: bold ; text-align: right;">
                                        <f:convertNumber pattern="#,##0.00" />
                                    </h:outputLabel>
                                </td>
                            </tr>
                        </table>
                        <p:spacer height="30px;"></p:spacer>
                        <table style="min-width:100%;padding-left: 20px;">
                            <tr>
                                <td style="min-width: 3cm;text-align: left; text-decoration: overline;">
                                    <h:outputLabel value="Cashier : #{cc.attrs.bill.creater.code}" style="font-size: 12px!important;"/>
                                </td>
                                <td style="text-align: left; text-decoration: overline;">
                                    <h:outputLabel value="#{cc.attrs.bill.staff.person.name}" style="font-size: 12px!important;"/>
                                </td>
                            </tr>
                        </table>
                    </div>
                    
                    <div class="itemsPrintingMid">

                        <h:dataTable value="#{cc.attrs.controller.billItems}" var="bip" style="font-size:11px!important;"     >

                            <h:column >
                                <h:outputLabel value="#{bip.referanceBillItem.bill.patient.person.nameWithTitle}" rendered="#{bf.bill.patientEncounter eq null}" style="margin: 4px;font-size:  11px!important;"  />                                    
                                <h:outputLabel value="#{bip.referanceBillItem.bill.patientEncounter.patient.person.nameWithTitle}" style="margin: 4px;font-size:  11px!important;"   />                                                                                
                            </h:column>

                        </h:dataTable>
                    </div>

                    <div class="ratesPrinting" >
                        <h:dataTable value="#{cc.attrs.controller.billItems}" var="bip1" style="font-size:  11px!important;"  >
                            <h:column>
                                <h:outputLabel value="#{bip1.netValue}"  style="margin: 4px;" >
                                    <f:convertNumber pattern="#,##0.00" />
                                </h:outputLabel>
                            </h:column>
                        </h:dataTable>


                    </div>

<!--                    <div class="totalsPrinting">
                        <table>
                            <tr>
                                <td style="text-align: right!important; font-size: 15px!important; font-weight: bold;">
                                    <h:outputLabel value="TOTAL"/>
                                </td>
                                <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
                                <td>
                                    <h:outputLabel value="#{-cc.attrs.bill.netTotal}"  style=" font-weight: bold ; text-align: right!important; font-size: 15px!important;">
                                        <f:convertNumber pattern="#,##0.00" />
                                    </h:outputLabel>
                                </td>
                            </tr>                      

                        </table>

                    </div>-->








                </div>

            </h:panelGroup>
        </div>

    </cc:implementation>
</html>
